/*****************************************************************************************************************
 * robot_object.h
 * 描述:定义一个需要序列化传递的类.
 * 作者:xhome
 * 时间:2020/5/21
 ****************************************************************************************************************/

#ifndef MEMORYBITSTREAM_ROBOTOBJECT_H
#define MEMORYBITSTREAM_ROBOTOBJECT_H

#include "memory_bit_stream.h"
#include <vector>

typedef  struct pos{
    int lon;
    int lat;
    int alt;

    pos(int lon, int lat, int alt)
    {
        this->lon = lon;
        this->lat = lat;
        this->alt = alt;
    }

}pos_t;

class RobotObject{

public:
    RobotObject(){}
    RobotObject(int id, int group_id, int state):
    id_(id), group_id_(group_id), state_(state)
    {

    }

    void write(OutputMemoryBitStream & in_output_stream);
    void read(InputMemoryBitStream & in_input_stream);

    int get_id(){ return id_;}
    int get_group_id() {return group_id_;}
    char get_state() { return  state_;}


public:
    int id_;
    int group_id_;
    char state_;
    int pos_count;
    std::vector<pos_t> pos_list_;
};

#endif //MEMORYBITSTREAM_ROBOTOBJECT_H
